#include <iostream>

using namespace  std;

void solve()
{
    int n, m, p, q;
    cin >> n >> m >> p >> q;
    if(m - n / p * q != 0 && n % p == 0) cout << "No" << endl;
    else cout << "Yes" << endl;
}

int main()
{
    int t; cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}